<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>QQListener: D:/MyProgramme/VC++/QQListener/arp.cpp文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- 制作者 Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>D:/MyProgramme/VC++/QQListener/arp.cpp文件参考</h1>里面集成了一些arp欺骗的操作  
<a href="#_details">更多...</a>
<p>
<code>#include &lt;pcap.h&gt;</code><br>
<code>#include &lt;windows.h&gt;</code><br>
<code>#include &quot;<a class="el" href="_q_q_listener_8h_source.html">QQListener.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="lanlist_8h_source.html">lanlist.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="arp_8h_source.html">arp.h</a>&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>函数</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d9773bb296e9be749e30af81c1879999"></a><!-- doxytag: member="arp.cpp::make_packet" ref="d9773bb296e9be749e30af81c1879999" args="(IN char *sz_chat_ip, IN PBYTE p_bt_mac, OUT PARP_PACKET p_arp_packet, bool b_chat)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>make_packet</b> (IN char *sz_chat_ip, IN PBYTE p_bt_mac, OUT PARP_PACKET p_arp_packet, bool b_chat)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#2e686b58f95de6d0e64146c425337006">find_qq_num</a> (PBYTE p_data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">在udp数据包中查找QQ号,并显示出来  <a href="#2e686b58f95de6d0e64146c425337006"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">DWORD WINAPI&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#bf408f0c5532217ea854a0f56b4bb21e">thread_listen</a> (LPVOID lpParameter)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">监听线程函数  <a href="#bf408f0c5532217ea854a0f56b4bb21e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">DWORD WINAPI&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#06d9e50b10cb31839dc069f69a110d65">thread_show</a> (LPVOID lpParameter)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">进行动态文本显示的线程函数,  <a href="#06d9e50b10cb31839dc069f69a110d65"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#f43fe35efa8cb884f825b3937fbce014">start_arp_chat</a> (PARP_PACKET p_arp_packet, PIP_LIST p_chat)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">这个函数进行开始arp欺骗并开启监听线程 开启动态显示线程,进入无死循环发送arp欺骗包  <a href="#f43fe35efa8cb884f825b3937fbce014"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#0d3f2cae04024ff346170672575dee52">send_recover_packet</a> (PARP_PACKET p_arp_recover)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">用来发送恢复包,恢复被欺骗主机的ARP表,使其正常工作  <a href="#0d3f2cae04024ff346170672575dee52"></a><br></td></tr>
<tr><td colspan="2"><br><h2>变量</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aaff73bdce23fabd3011bdccdd0894e1"></a><!-- doxytag: member="arp.cpp::g_p_dev_handle" ref="aaff73bdce23fabd3011bdccdd0894e1" args="" -->
pcap_t *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#aaff73bdce23fabd3011bdccdd0894e1">g_p_dev_handle</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">用来保存用户所选并且已经打开的设备的指针 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4e97737122abbd58fe40e038d1ef1153"></a><!-- doxytag: member="arp.cpp::g_bt_local_mac" ref="4e97737122abbd58fe40e038d1ef1153" args="[6]" -->
BYTE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#4e97737122abbd58fe40e038d1ef1153">g_bt_local_mac</a> [6]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">本机mac <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a8803747be9a78c0f5b603f2deb0b53a"></a><!-- doxytag: member="arp.cpp::g_bt_gateway_mac" ref="a8803747be9a78c0f5b603f2deb0b53a" args="[6]" -->
BYTE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#a8803747be9a78c0f5b603f2deb0b53a">g_bt_gateway_mac</a> [6]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">网关mac <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7f184643741eeb122b1841c807c5e09e"></a><!-- doxytag: member="arp.cpp::g_sz_gateway_ip" ref="7f184643741eeb122b1841c807c5e09e" args="[18]" -->
char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#7f184643741eeb122b1841c807c5e09e">g_sz_gateway_ip</a> [18]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">网关IP <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b07d11207a92ea0d1626324cde88983d"></a><!-- doxytag: member="arp.cpp::g_sz_local_ip" ref="b07d11207a92ea0d1626324cde88983d" args="[18]" -->
char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#b07d11207a92ea0d1626324cde88983d">g_sz_local_ip</a> [18]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">网关IP <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2cc064a825357f79c319bf50217c89dc"></a><!-- doxytag: member="arp.cpp::g_thread_listen" ref="2cc064a825357f79c319bf50217c89dc" args="" -->
HANDLE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#2cc064a825357f79c319bf50217c89dc">g_thread_listen</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">监听线程的句柄 <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a186efea01f58dd986107cfcd6ad4e67"></a><!-- doxytag: member="arp.cpp::g_u_qq_num" ref="a186efea01f58dd986107cfcd6ad4e67" args="[10]" -->
ULONG&nbsp;</td><td class="memItemRight" valign="bottom"><b>g_u_qq_num</b> [10] = {0}</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7db7065298002d2e4fe4bf22f0c72927"></a><!-- doxytag: member="arp.cpp::g_qq_num_index" ref="7db7065298002d2e4fe4bf22f0c72927" args="" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="arp_8cpp.html#7db7065298002d2e4fe4bf22f0c72927">g_qq_num_index</a> = 0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">用来保存有多少个QQ号 <br></td></tr>
</table>
<hr><h2>详细描述</h2>
里面集成了一些arp欺骗的操作 
<p>
<hr><h2>函数文档</h2>
<a class="anchor" name="2e686b58f95de6d0e64146c425337006"></a><!-- doxytag: member="arp.cpp::find_qq_num" ref="2e686b58f95de6d0e64146c425337006" args="(PBYTE p_data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void find_qq_num           </td>
          <td>(</td>
          <td class="paramtype">PBYTE&nbsp;</td>
          <td class="paramname"> <em>p_data</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
在udp数据包中查找QQ号,并显示出来 
<p>
<dl compact><dt><b>参数:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>p_data</em>&nbsp;</td><td>udp数据 </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="0d3f2cae04024ff346170672575dee52"></a><!-- doxytag: member="arp.cpp::send_recover_packet" ref="0d3f2cae04024ff346170672575dee52" args="(PARP_PACKET p_arp_recover)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void send_recover_packet           </td>
          <td>(</td>
          <td class="paramtype">PARP_PACKET&nbsp;</td>
          <td class="paramname"> <em>p_arp_recover</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
用来发送恢复包,恢复被欺骗主机的ARP表,使其正常工作 
<p>
<dl compact><dt><b>参数:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>p_arp_recover</em>&nbsp;</td><td>正确的arp数据包 </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="f43fe35efa8cb884f825b3937fbce014"></a><!-- doxytag: member="arp.cpp::start_arp_chat" ref="f43fe35efa8cb884f825b3937fbce014" args="(PARP_PACKET p_arp_packet, PIP_LIST p_chat)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void start_arp_chat           </td>
          <td>(</td>
          <td class="paramtype">PARP_PACKET&nbsp;</td>
          <td class="paramname"> <em>p_arp_packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PIP_LIST&nbsp;</td>
          <td class="paramname"> <em>p_chat</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
这个函数进行开始arp欺骗并开启监听线程 开启动态显示线程,进入无死循环发送arp欺骗包 
<p>
<dl compact><dt><b>参数:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>p_arp_packet</em>&nbsp;</td><td>arp欺骗包 </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>p_chat</em>&nbsp;</td><td>要欺骗主机信息结构体 </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="bf408f0c5532217ea854a0f56b4bb21e"></a><!-- doxytag: member="arp.cpp::thread_listen" ref="bf408f0c5532217ea854a0f56b4bb21e" args="(LPVOID lpParameter)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DWORD WINAPI thread_listen           </td>
          <td>(</td>
          <td class="paramtype">LPVOID&nbsp;</td>
          <td class="paramname"> <em>lpParameter</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
监听线程函数 
<p>
<dl compact><dt><b>参数:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lpParameter</em>&nbsp;</td><td>自定义参数 </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>返回:</b></dt><dd>见msdn </dd></dl>

</div>
</div><p>
<a class="anchor" name="06d9e50b10cb31839dc069f69a110d65"></a><!-- doxytag: member="arp.cpp::thread_show" ref="06d9e50b10cb31839dc069f69a110d65" args="(LPVOID lpParameter)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DWORD WINAPI thread_show           </td>
          <td>(</td>
          <td class="paramtype">LPVOID&nbsp;</td>
          <td class="paramname"> <em>lpParameter</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
进行动态文本显示的线程函数, 
<p>
<dl compact><dt><b>参数:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>lpParameter</em>&nbsp;</td><td>见msdn </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>返回:</b></dt><dd>见msdn </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated at Wed Oct 7 12:50:14 2009 for QQListener by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>
